<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta name="Author" contect="http://www.webqin.net">
    <title>忘记密码</title>
    <link rel="shortcut icon" href="images/favicon.ico"/>
    <link type="text/css" href="css/css.css" rel="stylesheet"/>
</head>

<body>

<div class="content">
    <div class="web-width">
        <div class="for-liucheng">
            <div class="liulist for-cur"></div>
            <div class="liulist for-cur"></div>
            <div class="liulist for-cur"></div>
            <div class="liulist"></div>
            <div class="liutextbox">
                <div class="liutext for-cur"><em>1</em><br/><strong>填写账户名</strong></div>
                <div class="liutext for-cur"><em>2</em><br/><strong>验证身份</strong></div>
                <div class="liutext for-cur"><em>3</em><br/><strong>设置新密码</strong></div>
                <div class="liutext"><em>4</em><br/><strong>完成</strong></div>
            </div>
        </div><!--for-liucheng/-->
        <form action="" method="get" class="forget-pwd">
            <dl>
                <dt>新密码：</dt>
                <dd><input type="password" class="pwd"/></dd>
                <div class="clears"></div>
            </dl>
            <dl>
                <dt>确认密码：</dt>
                <dd><input type="password" class="newPwd"/></dd>
                <div class="clears"></div>
            </dl>
            <div class="subtijiao"><input type="submit" onclick="forgetPwd()" value="提交"/></div>
        </form><!--forget-pwd/-->
    </div><!--web-width/-->
</div><!--content/-->

</body>
<script type="text/javascript" src="../home/js/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="../home/js/config.js"></script>
<script>

    sessionStorage.setItem("code_time", null);
    function forgetPwd() {

        var password = $('.pwd').val();
        var newPwd = $('.newPwd').val();
        if (password != newPwd) {
            alert("两次密码不一致");
            return
        }
        $.ajax({

            url: baseUrl + '/account/forgetPwd',
            type: 'PUT',
            data: {
                account: sessionStorage.getItem("userAccount"),
                code: sessionStorage.getItem("code"),
                password: password
            },
            async: false,
            success: function (res) {

                if (res.code == '0200') {
                    $('.forget-pwd').attr("action", "forgetPwd4.html");
                    sessionStorage.clear();
                    $('.forger-pwd').submit();
                } else {
                    alert("重置密码失败,error:" + res.msg)
                }
            }
        })
    }
</script>
</html>
